package operand;

/**
 * The {@link MyValue} class can store a single value of the type &ltT&gt.
 *
 * @param <T> is the type of this {@link MyValue}.
 */
public class MyValue<T> extends Operand<T>{
	
	private final T value;
	
	/**
	 * Constructor of {@link MyValue}.
	 * @param value is the value that is stored.
	 */
	public MyValue(final T value) {
		this.value = value;
	}
	
	/**
	 * Provides the stored value.
	 * @return the stored value.
	 */
	public T getValue() {
		return this.value;
	}
	@Override
	public Operand<T> accept(final OperandVisitor<T> visitor) {
		return visitor.visit(this);
	}
	@Override
	public void accept(final OperandVisitorWithoutResult<T> visitor) {
		visitor.visit(this);
	}
}
